//
//  WBComposeButton.swift
//  Weibo
//
//  Created by xu on 2017/3/27.
//  Copyright © 2017年 xuantong. All rights reserved.
//

import UIKit

class WBComposeButton: UIButton {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    var composeModel: WBComposeModel?

  
    //去除按钮的高亮状态
    override var isHidden: Bool{
        set {
            
        }get {
            
            return false
        }
    }
    
    //返回按钮的文字frame
     override func titleRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: 80, width: 80, height:110 - 80)
    }
    
    //返回按钮的图片frame
    override func imageRect(forContentRect contentRect: CGRect) -> CGRect {
        return CGRect(x: 0, y: 0, width: 80, height:80)
    }

 
       
    //搭建界面
    private func setupUI(){
        //填充模型
        imageView?.contentMode = .center
        // 文字居中
        titleLabel?.textAlignment = .center
        titleLabel?.font = UIFont.systemFont(ofSize: FONTSIZEOFNORMAL)
        self.setTitleColor(UIColor.darkGray, for: UIControlState.normal)

    }
        

    
}
